<!--# layout("/common/layout.html",{"jsBase":"/js/base/baseSuggest/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="suggestId" id="suggestId">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">建议标题</label>
				<div class="layui-input-inline">
                                <input type="text" name="title" id="title" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">建议描述</label>
				<div class="layui-input-inline">
                                <input type="text" name="describe" id="describe" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">附件</label>
				<div class="layui-input-inline">
                                <input type="text" name="file" id="file" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">联系电话</label>
				<div class="layui-input-inline">
                                <input type="text" name="phone" id="phone" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">是否公开[0-不公开 1-公开]</label>
				<div class="layui-input-inline">
                                <input type="text" name="isOpen" id="isOpen" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">是否推荐[0-不推荐 1-推荐]</label>
				<div class="layui-input-inline">
                                <input type="text" name="isTop" id="isTop" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">会员ID</label>
				<div class="layui-input-inline">
                                <input type="text" name="customerId" id="customerId" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">来源模块 14、公开课，15、圣达信教育，16、志愿填报，17、自主招生，18、艺考生</label>
				<div class="layui-input-inline">
                                <input type="text" name="module" id="module" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">来源渠道 miniprogram、自有微信小程序，h5、自有h5，gaosan、高三网app，h6、高三网h5引流</label>
				<div class="layui-input-inline">
                                <input type="text" name="channelCode" id="channelCode" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">创建时间</label>
				<div class="layui-input-inline">
            <input type="text" name="createdTime"  id="createdTime" autocomplete="off" class="layui-input input-date" >
				</div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.extend({
    loading: '../../../plugins/layui_extends/loading/loading',
}).define([ 'form', 'laydate', 'table','loading','baseSuggestApi'], function(exports) {
    var form = layui.form;
    var baseSuggestApi = layui.baseSuggestApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(baseSuggestJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                // $("#addButton").hide();
                // $("#addButton-loading").show();
                // $("#addButton-loading").loading();
                form.on('submit(form)', function(){
                    baseSuggestApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(baseSuggestJson))){  -->
    var formJson = ${baseSuggestJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
